package com.cmower.baeldung.enum1;

public class Player1 {
    private PlayerType type;
public enum PlayerType {
    TENNIS("网球",18),
    FOOTBALL("足球",18),
    BASKETBALL("篮球",18);

    private String name;
    private int age;

    PlayerType(String name, int age) {
        this.name = name;
        this.age = age;
    }
}

    public boolean isBasketballPlayer() {
      return getType() == PlayerType.BASKETBALL;
    }

    public PlayerType getType() {
        return type;
    }

    public void setType(PlayerType type) {
        this.type = type;
    }
}
